Automatically Hierarchic Categories in Menu - WP Plugin

Automatically Hierarchic Categories in Menu - WordPress Plugin
It allows you to automatically add hierarchical categories to WordPress navigation menus using shortcodes. All sub-categories, if any, are also dynamically created in sub-branches. If you have a long list of categories and subcategories, it takes a lot of time to select items one by one in the WordPress menu section. When there is a change in the categories, it is necessary to add / remove / change the order again in the menu. This WordPress plugin makes it programmatic. Creates auto populated menu with categories.

Automatically Hierarchic Categories in Menu Pro

You can see what the plugin does and how it works with the free version. Pro version works together with the free version, and extends it. More parameters become available with the Pro version.

To get the Pro version by donating or to make the plugin compatible with your theme, you can contact me by filling out the form or write to me on Telegram. Each deal is for one domain. There is no time limit, it can be used for lifetime. You can send your donation to my crypto wallet very quickly. Also, you can transfer money using Binance Pay with zero commissions - fees - charges. If you are not a member, you can create an account by following this link (with reference).

Pro features:
⭐ Custom taxonomy compatibility (tag, custom post category)
⭐ Add sub item at the beginning / end of the link text
⭐ Trailing slash on url link
⭐ Removed credits link
⭐ Show the number of posts in a category
⭐ Selecting root items to be included in the menu by ID
⭐ Sorting menu items (Alphabetical ascending - descending)

To-do list:
☐ Add active CSS class to current element
☐ Using the category's image in the menu item (icon, flag etc.)

Customization is required for themes that use a complex menu structure. I can offer you a professional solution for this. Set up a staging site that is an exact copy of your production website on a temporary domain or subdomain for customization and development. Create your goal menu with manually added items. I can ask you to give me access as an administrator. This will help me to check the structure of the menu and find the solution.

How to automatically add hierarchic categories in WordPress Navigation Menus ?

You can use this WordPress plugin:
Automatically Hierarchic Categories in Menu - WordPress Plugin Download

If you like the plugin, please give 5 stars. Your positive feedback is important for me.

This plugin works well with many themes. If you are using a theme that uses a standard menu structure, the plugin generates the menu with zero configuration. However, some themes produce menus with a different structure. HTML elements and/or their CSS class names may differ. In this case the menu will not appear correctly on your website according to your theme. This is because of your theme, not the plugin. HTML and CSS knowledge may be required depending on the theme. If you have HTML and CSS knowledge, there is the possibility to adapt it to your theme using parameters. For themes that use complex menus, getting Pro version and customization would be the solution for you.

Usage

You can make some customizations for your theme by using parameters and values in the shortcode.

Parameters

Parameter	Default			Description
taxonomy	category		taxonomy type
exclude		false			exclude taxonomy id(s)
level		2			hierarchy max level
prnt_tag	ul			parent tag, dom name
prnt_cls	sub-menu		parent tag, class
chld_tag	li			child tag, dom name
chld_cls	menu-item		child tag, class
chld_chc	menu-item-has-children	child tag, has children class
chld_cid	false			add id to class
a_cls		false			default link class
subi_bfr	false			sub item, before for has children item
subi_aft	false			sub item, after has children item
nline		"\n"			new line
linkget		false			extra get parameter after link
hide_empty	1			hide categories with empty items

taxonomy:
Type of 'taxonomy'. Do not ignore this parameter for post categories. To use WooCommerce product categories as menu items, give the value 'product_cat'. Example: [autocategorymenu taxonomy="product_cat"]
exclude:
Use this parameter for the categories that you want to exclude in the menu. Specify the category IDs that you want to exclude. Combine ID numbers with commas without spaces. Example: exclude="123,124"
level:
Maximum level limit value. If you give the value '1', only the items at the top root level are included in the menu. No subcategories are added to the menu. if you set the value '2', the root categories and the subcategories of these categories are added to the menu.
prnt_tag:
Parent tag's dom name. The HTML element that will enclose the menu items.
prnt_cls:
Parent tag's class. The class value of the HTML element that will contain the menu items.
chld_tag:
The HTML element in which the menu items are sorted.
chld_cls:
The class value of the HTML element that is a menu item.
chld_chc:
The class value of the menu item that has a subcategory.
chld_cid:
To add the ID of the menu item to the class of the menu HTML element, give the value '1'.
a_cls:
To assign the class value of the HTML address link element (a), set a value.
subi_bfr:
The content before the element (a) of the menu item, which is a subcategory.
subi_aft:
The content after the element (a) of the menu item, which is a subcategory.
nline:
Adds new lines after each HTML element. It ensures the readability of the source code. Give a null value to minimize the HTML code. Example: nline=""
linkget:
Get extra parameter after link. The link address domain.com/category instead of domain.com/category?reg=val to replace it with, give the value reg=val.
hide_empty:
By default, categories that do not have any posts in them are not added to the menu. To add categories that do not contain posts to the menu, give the value '0'.

Paid PRO version parameters

Parameter	Default
subi_atb	false
subi_ate	false
t_slash		true
txtcount	false
cntnr_1s	false
cntnr_1e	false
prnt_co1	false
prnt_ca1	false
startids	false
sortname	false
fn_custom	false

subi_atb
Content before the name of the menu item that has the subcategory.
subi_ate
Content after the name of the menu item that has the subcategory.
t_slash
Add trailing slash end of the link.
txtcount
Add total post count to category name. Sample value: " (%s)", Sample result: "Travel (5)"
cntnr_1s
Content before the HTML element enclosing (default ul) the subcategory list.
cntnr_1e
Content after the HTML element enclosing (default ul) the subcategory list.
prnt_co1
CSS selector value to overwrite after level 1 of the class of the HTML element (default ul) containing the subcategory list.
prnt_ca1
CSS selector value to be added after level 1 to the class of the HTML element (default ul) containing the subcategory list.
startids
Selection of root items to be included in the menu by ID. Type the ID(s) of the categories. To exclude the category itself and include all its subcategories, type the negative of the ID value. Combine multiple IDs with commas without spaces. For example: "101,102,-103"
sortname
Sort the category items alphabetically. Available values: "ASC", "DESC"
fn_custom
It is used for special functions written for a fee for theme menus whose structure is not standard.

Sample shortcode (⭐= Pro ) Menu tree Sample screen
Show all categories, even if there is no post in them:
[autocategorymenu level="4" hide_empty="0"]
┌───● Cat Id 1
├───■ Cat Id 2
│   ├───● Cat Id 21
│   └───● Cat Id 22
├───■ Cat Id 3
│   ├───● Cat Id 31
│   ├───■ Cat Id 32
│   │   ├───● Cat Id 321
│   │   ├───● Cat Id 322
│   │   └───● Cat Id 323
│   └───● Cat Id 33
└───■ Cat Id 4
    └───■ Cat Id 41
        └───■ Cat Id 411
            └───● Cat Id 4111
Show all categories, even if there is no post in them: [autocategorymenu level='4' hide_empty='0']
Include only the category with ID number 2 and all categories in its sub-hierarchy:
⭐[autocategorymenu startids="2"]
────■ Cat Id 2
    ├───● Cat Id 21
    └───● Cat Id 22
Include only the category with ID number 2 and all categories in its sub-hierarchy: [autocategorymenu startids='2']
Include only the category with ID number 32 and all categories in its sub-hierarchy, move 2rd level target category to root level:
⭐[autocategorymenu startids="32"]
────■ Cat Id 32
    ├───● Cat Id 321
    ├───● Cat Id 322
    └───● Cat Id 323
Include only the category with ID number 32 and all categories in its sub-hierarchy, move 3rd level target category to root level: [autocategorymenu startids='32']
Include all subcategories of the category with ID number 3 without including itself:
⭐[autocategorymenu startids="-3"]
┌───● Cat Id 31
├───■ Cat Id 32
│   ├───● Cat Id 321
│   ├───● Cat Id 322
│   └───● Cat Id 323
└───● Cat Id 33
Include all subcategories of the category with ID number 3 without including itself: [autocategorymenu startids='-3']
Include multiple items at once:
⭐[autocategorymenu startids="1,2,-411"]
┌───● Cat Id 1
├───■ Cat Id 2
│   ├───● Cat Id 21
│   └───● Cat Id 22
└───● Cat Id 4111
Include multiple items at once: [autocategorymenu startids='1,2,-411']
Sort the menu items in descending order:
⭐[autocategorymenu level="4" sortname="DESC"]
┌───■ Cat Id 4
│   └───■ Cat Id 41
│       └───■ Cat Id 411
│           └───● Cat Id 4111
├───■ Cat Id 3
│   ├───● Cat Id 33
│   ├───■ Cat Id 32
│   │   ├───● Cat Id 323
│   │   ├───● Cat Id 322
│   │   └───● Cat Id 321
│   └───● Cat Id 31
├───■ Cat Id 2
│   ├───● Cat Id 22
│   └───● Cat Id 21
└───● Cat Id 1
			
Sort the menu items in descending order. [autocategorymenu level='4' sortname='DESC']
WoodMart Theme Mobile navigation auto menu:
⭐[autocategorymenu level="4" chld_cls="menu-item menu-simple-dropdown wd-event-hover" a_cls="woodmart-nav-link" prnt_cls="wd-sub-menu" prnt_co1="sub-sub-menu"]

Setup: Appearance > Menus > Manage Locations > Main Menu > [Menu Name]
┌───● Cat Id 1
├───■ Cat Id 2
│   ├───● Cat Id 21
│   └───● Cat Id 22
├───■ Cat Id 3
│   ├───● Cat Id 31
│   ├───■ Cat Id 32
│   │   ├───● Cat Id 321
│   │   ├───● Cat Id 322
│   │   └───● Cat Id 323
│   └───● Cat Id 33
└───■ Cat Id 4
    └───■ Cat Id 41
        └───■ Cat Id 411
            └───● Cat Id 4111
WoodMart Theme Mobile navigation auto menu
WoodMart Theme desktop main navigation auto menu:
⭐[autocategorymenu level="4" prnt_ca1="wd-dropdown" chld_cls="menu-item menu-simple-dropdown wd-event-hover" a_cls="woodmart-nav-link" prnt_cls="sub-menu wd-sub-menu" cntnr_1e="</div></div>" cntnr_1s="<div class='color-scheme-dark wd-design-default wd-dropdown-menu wd-dropdown'><div class='container'>"]

Setup: WoodMart > Header Builder > Header Base (Edit) > Desktop > Header bottom > Main menu (Edit) > Choose menu > [Menu Name]
┌───● Cat Id 1
├───■ Cat Id 2
│   ├───● Cat Id 21
│   └───● Cat Id 22
├───■ Cat Id 3
│   ├───● Cat Id 31
│   ├───■ Cat Id 32
│   │   ├───● Cat Id 321
│   │   ├───● Cat Id 322
│   │   └───● Cat Id 323
│   └───● Cat Id 33
└───■ Cat Id 4
    └───■ Cat Id 41
        └───■ Cat Id 411
            └───● Cat Id 4111
WoodMart Theme desktop main navigation auto menu
WoodMart Theme desktop left categories navigation:
⭐[autocategorymenu level="4" prnt_ca1="wd-dropdown" chld_cls="menu-item menu-simple-dropdown wd-event-hover" a_cls="woodmart-nav-link" prnt_cls="sub-menu wd-sub-menu" cntnr_1e="</div></div>" cntnr_1s="<div class='color-scheme-dark wd-design-default wd-dropdown-menu wd-dropdown'><div class='container'>"]

Setup: WoodMart > Header Builder > Header Base (Edit) > Desktop > Header bottom > Categories (Edit) > Choose menu > [Menu Name]
┌───● Cat Id 1
├───■ Cat Id 2
│   ├───● Cat Id 21
│   └───● Cat Id 22
├───■ Cat Id 3
│   ├───● Cat Id 31
│   ├───■ Cat Id 32
│   │   ├───● Cat Id 321
│   │   ├───● Cat Id 322
│   │   └───● Cat Id 323
│   └───● Cat Id 33
└───■ Cat Id 4
    └───■ Cat Id 41
        └───■ Cat Id 411
            └───● Cat Id 4111
WoodMart Theme desktop left categories navigation auto menu
WoodMart Theme desktop full-width dropdown grid - columns menu:
⭐[autocategorymenu lng_label="My Label" fn_custom="woodmart01"]

Setup: WoodMart > Header Builder > Header Base (Edit) > Desktop > Header bottom > Menu (Edit) > Choose menu > [Menu Name]
Appearance > Menus > Edit Menus > [Menu Name] > Extra options > CSS Classes (optional) : menu-item-has-children
┌───● Cat Id 1
├───■ Cat Id 2
│   ├───● Cat Id 21
│   └───● Cat Id 22
├───■ Cat Id 3
│   ├───● Cat Id 31
│   ├───● Cat Id 32
│   └───● Cat Id 33
└───■ Cat Id 4
    └───● Cat Id 41
WoodMart Theme desktop full-width dropdown grid - columns menu
Flatsome Theme desktop Main Menu: Please donate
┌───● Cat Id 1
├───■ Cat Id 2
│   ├───● Cat Id 21
│   └───● Cat Id 22
├───■ Cat Id 3
│   ├───● Cat Id 31
│   ├───● Cat Id 32
│   └───● Cat Id 33
└───■ Cat Id 4
    └───● Cat Id 41
WoodMart Theme desktop left categories navigation auto menu
Flatsome Theme mobile Main Menu: Please donate
┌───● Cat Id 1
├───■ Cat Id 2
│   ├───● Cat Id 21
│   └───● Cat Id 22
├───■ Cat Id 3
│   ├───● Cat Id 31
│   ├───■ Cat Id 32
│   │   ├───● Cat Id 321
│   │   ├───● Cat Id 322
│   │   └───● Cat Id 323
│   └───● Cat Id 33
└───■ Cat Id 4
    └───■ Cat Id 41
        └───■ Cat Id 411
            └───● Cat Id 4111
WoodMart Theme desktop left categories navigation auto menu
Woodmart Demo - test environment: Imported "Woodmart Main" prebuilt website on theme version 7.1.4, WordPress version 6.3.1, PHP version 7.4 / 8.2, WooCommerce Version 8.1.1
Flatsome Demo - test environment: Imported "Classic Shop" prebuilt website on theme version 3.15.6, WordPress version 6.3.1, PHP version 7.4 / 8.2, WooCommerce Version 8.1.1


Shortcode Helper

Your shortcode:
[autocategorymenu]
Reset
Menu items:
Exclude item id(s):
Maximum hierarchy level:
Extra get parameter after link:
<ul id="primary-menu" class="menu-container"> < class=""> ¦ <a href="#" class="">Level 1, Item 1</a> </li> <li class="menu-item"> ¦ <a href="#">Level 1, Item 2</a> </li> <li class="menu-item "> ¦ ¦ <a href="#">Level 1, Item 3</a> ¦ ¦ < class=""> ¦ ¦ <li class="menu-item"> ¦ ¦ ¦ <a href="#">Level 2, Item 3.1</a> ¦ ¦ </li> ¦ </ul> </li> <li class="menu-item menu-item-has-children"> ¦ ¦ <a href="#">Level 1, Item 4</a> ¦ ¦ <ul class="sub-menu"> ¦ ¦ <li class="menu-item"> ¦ ¦ ¦ <a href="#">Level 2, Item 4.1</a> ¦ ¦ </li> ¦ ¦ <li class="menu-item"> ¦ ¦ ¦ <a href="#">Level 2, Item 4.2</a> ¦ ¦ </li> ¦ </ul> </li>
Your shortcode:
[autocategorymenu]


This plugin works with most of WordPress themes. Sometimes you have to use some extra parameters. Here are examples for the free version.

<ul id="primary-menu-list" class="menu-wrapper">
  <li id="menu-item-16006" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-16006"><a href="#">Lost password</a></li>
  <li id="menu-item-16004" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-16004"><a href="#">Account</a>
    <button class="sub-menu-toggle" aria-expanded="false" onClick="twentytwentyoneExpandSubMenu(this)"><span class="icon-plus"><svg class="svg-icon" width="18" height="18" aria-hidden="true" role="img" focusable="false" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z" fill="currentColor"/></svg></span><span class="icon-minus"><svg class="svg-icon" width="18" height="18" aria-hidden="true" role="img" focusable="false" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6 11h12v2H6z" fill="currentColor"/></svg></span><span class="screen-reader-text">Open menu</span></button>
    <ul class="sub-menu">
      <li id="menu-item-16003" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-16003"><a href="#">Address</a></li>
      <li id="menu-item-16001" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-16001"><a href="#">Orders</a>
        <ul class="sub-menu">
          <li id="menu-item-16002" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-16002"><a href="#">Downloads</a></li>
        </ul>
      </li>
      <li id="menu-item-16005" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-16005"><a href="#">Logout</a></li>
    </ul>
  </li>
</ul>

level : 2
chld_cls : menu-item menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children
chld_chc : menu-item-has-children
subi_aft : <button class="sub-menu-toggle" aria-expanded="false" onClick="twentytwentyoneExpandSubMenu(this)"><span class="icon-plus"><svg class="svg-icon" width="18" height="18" aria-hidden="true" role="img" focusable="false" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z" fill="currentColor"/></svg></span><span class="icon-minus"><svg class="svg-icon" width="18" height="18" aria-hidden="true" role="img" focusable="false" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6 11h12v2H6z" fill="currentColor"/></svg></span><span class="screen-reader-text">Open menu</span></button>

Shortcode : [autocategorymenu hide_empty="0" level="2" chld_cls="menu-item menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children" chld_chc="menu-item-has-children" subi_aft='<button class="sub-menu-toggle" aria-expanded="false" onClick="twentytwentyoneExpandSubMenu(this)"><span class="icon-plus"><svg class="svg-icon" width="18" height="18" aria-hidden="true" role="img" focusable="false" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z" fill="currentColor"/></svg></span><span class="icon-minus"><svg class="svg-icon" width="18" height="18" aria-hidden="true" role="img" focusable="false" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6 11h12v2H6z" fill="currentColor"/></svg></span><span class="screen-reader-text">Open menu</span></button>']

<ul class="primary-menu reset-list-style">
  <li id="menu-item-6" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-6"><a href="#">Bulk 0</a></li>
  <li id="menu-item-8" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-8">
    <a href="#">Bulk 1</a>
    <span class="icon"></span>
    <ul class="sub-menu">
      <li id="menu-item-9" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-9"><a href="#">Bulk 1 . 1</a></li>
      <li id="menu-item-10" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-10"><a href="#">Bulk 1 . 2</a></li>
    </ul>
  </li>
</ul>

subi_aft : <span class="icon"></span>

Shortcode : [autocategorymenu hide_empty="0" level="3" subi_aft='<span class="icon"></span>']

<div class="menu-main-menu-auto-container">
  <ul id="menu-main-menu-auto" class="main-menu" tabindex="0">
    <li id="menu-item-6" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-6"><a href="#">Bulk 0</a></li>
    <li id="menu-item-8" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-8">
      <a href="#" aria-haspopup="true" aria-expanded="false">Bulk 1</a>
      <span class="submenu-expand" tabindex="-1">
        <svg class="svg-icon" width="24" height="24" aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"></path><path fill="none" d="M0 0h24v24H0V0z"></path></svg>
      </span>
      <ul class="sub-menu">
        <li id="menu-item--1" class="mobile-parent-nav-menu-item menu-item--1"><span class="menu-item-link-return" tabindex="-1"><svg class="svg-icon" width="24" height="24" aria-hidden="true" role="img" focusable="false" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg>Bulk 1</span></li>
        <li id="menu-item-9" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-9"><a href="#">Bulk 1 . 1</a></li>
        <li id="menu-item-10" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-10"><a href="#">Bulk 1 . 2</a></li>
      </ul>
    </li>
  </ul>
</div>

subi_aft : <span class="submenu-expand" tabindex="-1"><svg class="svg-icon" width="24" height="24" aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"></path><path fill="none" d="M0 0h24v24H0V0z"></path></svg></span>

Shortcode : [autocategorymenu hide_empty="0" subi_aft='<span class="submenu-expand" tabindex="-1"><svg class="svg-icon" width="24" height="24" aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"></path><path fill="none" d="M0 0h24v24H0V0z"></path></svg></span>']

<ul id="ast-hf-menu-1" class="main-header-menu ast-nav-menu ast-flex  submenu-with-border astra-menu-animation-fade  stack-on-mobile">
  <li id="menu-item-6" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-6"><a href="#" class="menu-link">Bulk 0</a></li>
  <li id="menu-item-8" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-8"><a href="#" class="menu-link">Bulk 1</a><button class="ast-menu-toggle" aria-expanded="false"><span class="screen-reader-text">Menu Toggle</span></button>
    <ul class="sub-menu">
      <li id="menu-item-9" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-9"><a href="#" class="menu-link">Bulk 1 . 1</a></li>
      <li id="menu-item-10" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-10"><a href="#" class="menu-link">Bulk 1 . 2</a><button class="ast-menu-toggle" aria-expanded="false"><span class="screen-reader-text">Menu Toggle</span></button>
        <ul class="sub-menu">
          <li id="menu-item-14" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-14"><a href="#" class="menu-link">xx</a></li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

a_cls : menu-link
level : 3

Shortcode : [autocategorymenu hide_empty="0" level="3" a_cls="menu-link"]

<ul id="primary-menu" class="menu">
  <li id="menu-item-6" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-6"><a href="#">Bulk 0</a></li>
  <li id="menu-item-8" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-8"><a href="#">Bulk 1</a>
    <ul class="sub-menu">
      <li id="menu-item-9" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-9"><a href="#">Bulk 1 . 1</a></li>
      <li id="menu-item-10" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-10"><a href="#">Bulk 1 . 2</a>
        <ul class="sub-menu">
          <li id="menu-item-14" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-14"><a href="#">xx</a></li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

level : 3

Shortcode : [autocategorymenu hide_empty="0" level="3"]

Shortcode : <nav class="is-horizontal is-content-justification-right is-layout-flex wp-container-2 is-responsive items-justified-right wp-block-navigation" aria-label="Header navigation"> <button aria-haspopup="true" aria-label="Open menu" class="wp-block-navigation__responsive-container-open " data-micromodal-trigger="modal-atakanau-1"> <svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false"> <rect x="4" y="7.5" width="16" height="1.5"></rect> <rect x="4" y="15" width="16" height="1.5"></rect> </svg> </button> <div class="wp-block-navigation__responsive-container " style="" id="modal-atakanau-1"> <div class="wp-block-navigation__responsive-close" tabindex="-1" data-micromodal-close=""> <div class="wp-block-navigation__responsive-dialog" aria-label="Menu"> <button aria-label="Close menu" data-micromodal-close="" class="wp-block-navigation__responsive-container-close"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"> <path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path> </svg> </button> <div class="wp-block-navigation__responsive-container-content" id="modal-atakanau-1-content"> <ul class="wp-block-navigation__container"> [autocategorymenu taxonomy0="product_cat" hide_empty="0" prnt_cls="wp-block-navigation__submenu-container" chld_cls="wp-block-navigation-item" chld_chc="has-child open-on-hover-click wp-block-navigation-submenu" a_cls="wp-block-navigation-item__content" subi_aft="<button aria-label='Bulk 1 submenu' class='wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle' aria-expanded='false'><svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' aria-hidden='true' focusable='false'><path d='M1.50002 4L6.00002 8L10.5 4' stroke-width='1.5'></path></svg></button>"] </ul> </div> </div> </div> </div> </nav>


== Changelog ==

= Version 2.0.7 =
* Security: XSS JavaScript inject
* Extended: PRO version compatibility
* Bumped up "Tested up to: 6.6.x"

= Version 2.0.5 =
* Simplified: Code comments
* Bumped up "Tested up to: 6.5"

= Version 2.0.4 =
* Modified: Info links
* Bumped up "Tested up to: 6.4.2"

= Version 2.0.3 =
* Modification: (Minor) Interface
* Bumped up "Tested up to: 6.3.1"

= Version 2.0.2 =
* Fixed: Pro version compatibility
* Bumped up "Tested up to: 6.3"

= Version 2.0.1 =
* Edited: Info text
* Bumped up "Tested up to: 6.2"

= Version 2.0.0 =
* Added: New option, add item id to menu item class
* Added: Taxonomy list on admin panel
* Added: Expandable with paid Pro version
* Dropped: Custom taxonomy support
* Bumped up "Tested up to: 6.1.1"

= Version 1.02 =
* Added: Null array item handler for base category path in PHP
* Fixed: Broken support link
* Bumped up "Tested up to: 6.0.1"

= Version 1.01 =
* Bumped up "Tested up to: 5.9"

= Version 1.00 =
* Initial version released


Recommended Wordpress Plugin
Free WhatsApp plugin for WordPress. Add the clickable WhatsApp button to your site. Compact, Simple, Speedy: CSS chat button. Lightweight and fast loading for best SEO.

woodmart category menu, woodmart mobile menu categories, flatsome mobile menu, wordpress create menu programatically, Astra, Avada, Divi, Hello, OceanWP, Sydney, Betheme, GeneratePress, The7, Porto, Phlox, Enfold, X, Uncode, WoodMart, Flatsome, Bridge, Jupiter, Salient, Newspaper, Hestia, OnePress, Neve, Impreza, Go, Kadence WP, TheGem, uDesign, Kallyas, Total, Brooklyn, Kalium, Soledad, Monstroid2, Shopkeeper, Eduma, Oshine, Visualmodo
Share:

68 comments:

  1. Hi. Love this plugin, I have been looking for something like this for ages. I am just having a little problem with it though - my categories are for a custom post type which has its own url, plus each category has its own category base set in the permalinks (which I can't remove). The plugin seems to simply go to the base URL and the category slug, ignoring the inbetween bits! Is there any way to fix this?
    Thanks

    ReplyDelete
    Replies
    1. Hi.
      Which shortcode did you use?
      How was a link in the menu created?
      What is the link in the menu supposed to be?

      Delete
  2. Hello hello, Usually specific “menu-item-…” is added as id + class to the li elements with normal WordPress menus. When using your plugin those classes, ids are not added to li‘s which makes it hard to hide certain entries etc.

    I only get this:

    li class="menu-item " or this:
    li class="menu-item menu-item-has-children"

    but no specific classes.

    I’m running “Hello” theme.

    Any ideas? Thanks!

    ReplyDelete
    Replies
    1. Hi, I updated the "Development Version". So please update plugin manual and add chld_cid="true" parameter to your shortcode. Let me know if you have any other issues.

      Delete
    2. I'm not totally sure where to download it. Could you send me a link to the zip? Thanks a lot!

      Delete
    3. Scroll down on the plugin’s page and click on the "Advanced View".
      Scroll to the bottom of the page and you will see an option to download previous versions of the plugin. Select "Development Version" option and click "Download" button.

      Delete
    4. Perfect. Now it's working. Thanks for taking your time. Really appreciated!

      Delete
  3. Plugin is awesome! I have 1,300 product categories on a website we are building and this really helped organize much easier.

    But, it just stopped working. It was working, and then stopped and now just displays the shortcode as text instead of the drop downs.

    Here is website: https://everybodyuniforms.com/

    The Theme is Divi which is so widely used I figured we would be okay. And it was working, then stopped. so, confused.

    Ideas to solve?

    ReplyDelete
    Replies
    1. Thanks.
      Can you share your installed theme and plugin details with me?
      Tools \ Site health \ Info

      Delete
    2. Thank you for the positive opinion.

      If the shortcode appears as plain text, it's because of a plugin or theme. Read the documentation of the theme/plugin you are using and see how the shortcode is used. This plugin works the same as before.

      Delete
  4. Hi, please is there possibility to show menu collapse? I am using Woodmart theme, and I need automatically added Product categories. Everything works, but I need only to show main category, and when hover on it, then shoe subcategory. Now its everything under main category as list. Thank you.

    ReplyDelete
    Replies
    1. Hello,
      Can you share the working demo link of the result you want to have?

      Delete
  5. Hello hello, could you imagine adding a "category image to nav items" funtionality. I'm using it for a "fake" polylanguage page and want to add language flags to my parent language categories. Thanks for your work. The plugin is really great! Cheers

    ReplyDelete
    Replies
    1. I guess category images can be used with or without names. I will keep this in mind. I can work on it later.
      Thank you for your praise.

      Delete
    2. Hi, amazing simple plugin, thanks! Has been any update about adding the category thumbnails or in the case of Woodmart theme, to be able to add the menu icon previously set in each product category?

      Delete
    3. Thank you. No, it doesn't have this feature. I can add it to the Pro version. You can use the contact form to hire me. I can work on it to do that.

      Delete
  6. Hello! Thank you for this great plugin!
    I'm using TheGem theme and WooCommerce, and I have many product categories. I want to have in the main menu a "Product categories" button and when the mouse is on this button to collapse with all product categories. The problem is that for now my menu contains buttons with all categories, but the "Product categories" button is missing. Otherwords, the button label is missing, but I have a lot of buttons with the categories.
    I used this shortcode: [autocategorymenu taxonomy="product_cat"]
    Could you please to advise me?

    ReplyDelete
    Replies
    1. Thanks. Is there a demo address where I can see it working?

      Delete
    2. I cannot provide you a link to my working site because it is local, but you can see the menu of the theme here: https://preview.themeforest.net/item/thegem-creative-multipurpose-highperformance-wordpress-theme/full_screen_preview/16061685
      I need a "Product categories" button and when hover on it, then show all categories.

      Delete
    3. Try this:
      https://tncyazilim.com/temp/iccWhh9AzH.png

      You can use tastewp.com for tests.

      Delete
  7. Hi. What parameter I need if I want to specify category name to display all posts under that category not all categories.

    ReplyDelete
    Replies
    1. What I understand is this: In the menu; Under the category, you want the posts included in that category. For example:
      - Colors (Cat.)
      -- Red (Post)
      -- Green (Post)
      -- Blue (Post)

      Sorry, this Plugin doesn't work that way. All of the menu items are categories. Maybe it will be possible to add this feature later.

      Delete
  8. Great plugin! I am having trouble though with a custom post type taxonomy: [autocategorymenu taxonomy="case_studies_category"]. The url comes out without the base of the custom taxonomy. I would expect the link url to be ".../case_studies_category/something/" but it is giving ".../something/" and those links give a 404 without the taxonomy base. Am I missing something? Thank you!

    ReplyDelete
    Replies
    1. Thank you for the positive opinion.
      Please, can you try with "Development Version". So please update plugin manual. I explained how to do it above.

      Delete
    2. I used this on another project and the development version worked great for the proper url for the custom post type taxonomy, thank you! Saved me tons of time. I may reach out to get a premium version of this because I'm using it on a huge project.

      Delete
  9. How can i add some levels in hierarchy? I have about 3 subcategories like "doors > small doors > handle. Now i've set 10 levels and it shows only subcategories

    ReplyDelete
    Replies
    1. Use the "level" parameter. The default value is 2. In this way, you only see the root and its first sub-branch elements. How many level branches do you want to use, assign this value. For example:[... level="3" ...]

      Delete
  10. add class with current menu should be there

    ReplyDelete
  11. Hi :-)
    thx for the pi (y)

    i have added the parent_id as attr, so it can be used in the shortcode, in:
    class-auto-hierarchic-category-menu.php
    line 196: ,'parent_id' => 0 // parent id to begin with
    line 237: $html=$this->atakanau_category($categories, $attr, home_url().$link_sub, $attr['parent_id'] );

    Would be great, if you can add it to your code for the next release (y) :-D

    thx for the good work!

    ReplyDelete
    Replies
    1. Thanks. This is a good idea. I will try and check on next release.

      Delete
  12. Hello! Is it possible to show only one category and its subcategories? How "included"?

    Shortcode includes all categories, too many to exclude

    ReplyDelete
    Replies
    1. Hello. Identifying the starting category with the ID number is on my to-do list. For example: [autocategorymenu root_ids="101,102,103"]

      Delete
    2. Please I really need this feature!

      Delete
  13. Hey
    Thank you for your amazing plugin!

    I have category name "advice" that contains a lot of posts.
    I want male the short code' should the shortcode neef to be like this:
    [autocategorymenu hide_empty="0"]
    [autocategorymenu taxonomy="advice"]

    Or maybe something like this:
    [autocategorymenu hide_empty="0"]
    [autocategorymenu category="advice"]

    Two of this sortcode doesn't work for me.
    I use the default WordPress for post and tags.

    Thanks :) !

    ReplyDelete
    Replies
    1. Thanks. There are only categories in the menu. There are no posts. For now you can exclude categories by id number, eg. [autocategorymenu exclude="101,102"]. Identifying the starting category with the ID number is on my to-do list. For example [autocategorymenu root_ids="101,102,103"]

      Delete
  14. Hi! Thank you for this plugin! Can you tell how to make it in order which I want?

    ReplyDelete
    Replies
    1. Thank you. Menu items are listed alphabetically. Adding the sort parameter is on my to-do list.

      Delete
    2. ok. We are waiting for it

      Delete
  15. Hi, Working on a Property site and there is a CPT for the properties with their own category taxonomy. Your plugin correctly identifies and displays the categories but the URL is missing a subfolder. This is what it should be https://ajo.casa/it/property_category/residenziale/ and this is what your plugin outputs https://ajo.casa/it//residenziale/

    Is there a way to fix this?

    ReplyDelete
    Replies
    1. I see that the plugin is used on your website. As you want it to be, the link generated in the menu already has the category base address and the subcategory address. As in: https://ajo.casa/it/property_category/residenziale/

      Delete
    2. Thanks, I worked it out by the time you checked it. I have a request. Please add the Ability to set an 'active' class to the A record (e.g. If link url = browser url then add class name) and the ability to edit the menu item after adding.

      Delete
    3. I have a feature request! Can you accept a optional argument "root_id" that takes a category id as input, and as a result of that being provided uses such id ad the root of the hierarchical tree being displayed?

      Delete
    4. Challenge accepted 🙂. Determining the starting category is on my to-do list. May be next release...

      Delete
  16. Hi i am have created a menu but when i insert the shortcode the items appear as a bullet list and not with dropdowns. I am using Breakdance builder. Is it possible to make the menu appear as it should normally is.

    ReplyDelete
    Replies
    1. Hello. This plugin creates the menu in HTML format. The appearance is related to the theme you are using. You have to customize generated HTML via plugin parameters, such as prnr_cls="???" . You can check the examples in the post. If you need professional help, you can write to me using contract page / form.

      Delete
  17. I am using the Shoptimizer theme by commercegurus and I cannot see the menu items come up at all using your plugin. Would this be an issue specifically with Shoptimizer?

    ReplyDelete
    Replies
    1. The menu produced by the theme you are using may be non-standard. You should use appropriate parameters according to the targeted CSS and HTML code. If you need professional help, you can reach me via the contact form.

      Delete
  18. Hi. Ive added your plugin to our website which is in development. We use a hover/slide-out menu with Generatepress but unfortunately it doesnt work on devices because when you touch a category it opens the category page instead of showing the next submenu.
    Please advise.
    Thanks

    ReplyDelete
    Replies
    1. Hello. What is the address of the demo site? The screenshot showing the situation you are talking about will be more understandable. You can use the contact form.

      Delete
  19. I am facing the same problem as previous users indicate in their posts. The category link is missing from the url. The url should be .../schools/school-1, but is .../school-1. I have the latest version in use, 2.0.1.
    My shortcode is [autocategorymenu taxonomy="scholen" hide_empty="0″]. The site is local only.
    I hope you can help

    ReplyDelete
    Replies
    1. I understand this; you are using the "scholen" custom taxonomy. To use custom taxonomy, you need to purchase the paid PRO version.

      Delete
  20. Nice post thank you Taylor

    ReplyDelete
  21. Love your plugin! Unfortunately, only top level categories are showing. Subcategories do not populate. Site is https://sustainablespree.com
    It is the hamburger menu (to the left of the search bar).
    Shortcode I am using is: [autocategorymenu taxonomy="product_cat" level="4"]

    ReplyDelete
    Replies
    1. Hi, try adding this parameter: prnt_cls="nav-sublist-dropdown"

      Delete
    2. Yup. That did it. Thanks!!

      Delete
  22. Hi there! This seems perfect but I'm having trouble with the URL structure.

    My category page URL looks like this:
    https://www.site.com/blogname/archives/category/characters/
    This plugin produces the following (invalid) url:
    https://www.site.com/blogname/category/characters/

    Any idea why this might be the case? Appreciate any insight you might have.

    Thanks!

    ReplyDelete
    Replies
    1. Hi, I confirm that the plugin is generating the correct link addresses.
      Even if you change the "Category base" value in the "Permalink" settings, it generates the correct category url accordingly:
      Default (empty):
      https://site.com/category/uncategorized/
      "kategori":
      https://site.com/kategori/uncategorized/
      "archives/category":
      https://site.com/archives/category/uncategorized/

      Possible causes of the problem:
      You are using custom taxonomy (PRO version required).
      You are using old version ( Update it )

      Delete
  23. hello, does the premium version include:
    - support and compatibility with elementor
    - in the case of categories (post or woocommerce), addition of the category slug as the element class
    - added active classes (elementor compatible)
    THANKS !

    ReplyDelete
    Replies
    1. Hello 👋
      + Yes, both the free and pro versions are compatible with all builder plugins that use shortcodes or the default WP menu base, including Elementor.

      + Adding the "slug" value of the category to the HTML "class" property: I can add it to the pro version. That's easy.

      + Automatically add the active class to the menu item is not available, for now. It's on my to-do list.

      Delete
  24. Hi There, any chance you have an integration for Elementor?

    ReplyDelete
    Replies
    1. Plugin also works with the Elementor Page Builder.

      Delete
  25. Is it compatible with Avada theme?

    I added shortcode with level="4" parameter to blog section of the main menu.
    But only top level category names are displayed, not post name in each category.

    ReplyDelete
    Replies
    1. Yes, the plugin is compatible with the Avada theme. This plugin adds categories (taxonomy) to the menu. The ability to add posts is a special request.

      Delete
  26. Hi!
    Thenks for the plugin.
    Its works fie to me:
    https://develop.supercenter.com.uy/
    I have a Question, there is anyway to show all the productos in two columns?

    thanks

    ReplyDelete
    Replies
    1. I think it works as you want now. If not, please write again.
      https://i.ibb.co/sQcvX4R/ss.png

      Delete
  27. Hi! Is it possible to add a different class to children link?

    For example:
    parent a_cls='menu-item'
    children a_cls='menu-sub-item'

    ReplyDelete
    Replies
    1. Hello. No; this is not possible for now. But I can add this special request to the PRO version.

      Delete

ⓘ Comment is published after moderation.


Subscribe to: Post Comments (Atom)